﻿using System;
using System.ComponentModel.DataAnnotations;

namespace TimeManager.Domain.Entities {

    public class Task {

        public Task() {
            TimeStart = DateTime.Now;
            Duration = new TimeSpan();
        }
        public Task(DateTime timeStart, TimeSpan duration) {
            TimeStart = timeStart;
            Duration = duration;
        }
        public Int32 TaskId { get; set; }
        [Required]
        public String Description { get; set; }
        [Required]
        public DateTime TimeStart { get; set; }
        [Required]
        public TimeSpan Duration { get; set; }

        [Required]
        public Int32 UserId { get; set; }
        public virtual User User { get; set; }

        [Required]
        public Int32 ProjectId { get; set; }
        public virtual Project Project { get; set; }

    }
}
